<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>取到符合条件</title>
	</head>
	<body>
		<script type="text/javascript">
			//需求：找出放在page1文件夹的下书，返回数组
			        let arr = [
			            { "name": "JavaScript权威指南", "filepath": "page2/index" },
			            { "name": "JavaScript高级程序设计", "filepath": "page1/index" },
			            { "name": "坏蛋是怎么炼成的", "filepath": "page1/index" },
			            { "name": "莽荒记", "filepath": "page2/index" }
			        ]
					var arr2 = arr.filter(function(value){
						return value.filepath.startsWith("page1");
					})
					console.log(arr2);
		</script>
	</body>
</html>
